/**
 * @Author       : cxh
 * @Date         : 2021-12-28 13:10:01
 * @LastEditTime : 2021-12-29 12:59:04
 * @LastEditors  : cxh
 * @Description  : 配置跨域及post请求参数解析及mongodb
 * @FilePath     : \vue_WorkSpace\egg-wpt-server\config\config.default.js
 */
/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1640668185906_3743';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };


  config.cors = {
    origin: '*',
  };

  config.bodyParser = {
    jsonLimit: '10mb',
  };

  config.mongoose = {
    url: 'mongodb://127.0.0.1/eggtest',
    loadModel: true,
    options: {},
    plugins: [],
  };

  config.security = {
    csrf: {
      enable: false,
    },
  };

  return {
    ...config,
    ...userConfig,
  };
};
